<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
{{assign var="title" value=$title|default:'分类'}}
{{assign var="app" value='category'}}
{{assign var="act" value=''}}
<title>{{$title}}{{$text}} - {{'admin|admin_site_name'|C|default:'后台管理'}}</title>
{{include file="include/base.html"}}
{{include file="{{$smarty.const.PLUG}}verify/verify.html"}}
</head>
<body>

	{{include file="include/sidebar.html"}}
	
	<div class="body_right">
	<div id="content">
	<div class="search">
	  <ul class="bread">
		<li>
		  ◆ {{$title}}管理 －＞ {{$text}}{{$title}}
		</li>
	  </ul>
	</div>
			
		<!--内容 S-->
		<form action="index.php?app=category&act=save" name="form1" class="form verify" id="form" method="post">
		<input type="hidden" name="URL_" value="{{$smarty.const.URL_}}"/>
		<input type="hidden" name="id" value="{{$result.id}}"/>
		<input type="hidden" name="verifyId" value="{{$smarty.get.id|default:$smarty.get.parent_id}}"/>
		<table class="table table-bordered modify">
		  <tbody>
		  	{{if $smarty.get.iframe!=true}}
			<tr class="thead">
			  <td colspan="7">
				<a href="{{$smarty.const.URL_}}" class="btn"><i class="icon-chevron-left"></i>返回上一页</a>
			  </td>
			</tr>
			{{/if}}
			<tr>
			  <td>标题：</td>
			  <td>
				<input class="input-xlarge" type="text" name="title" maxlength="50" value="{{$result.title}}"> <span class="red">*</span>
			  </td>
			</tr>
			{{if $result.parent_id>0}}
			<tr>
			  <td>归属父分类：</td>
			  <td>
				<input type="hidden" name="parent_id" value="{{$result.parent_id}}"/>
				<span class="cat_name">{{$cat_name}}</span>
				<span class="red">*</span>
					<select class="select_parent_category" style="display:none;">
						{{html_options options=$parent selected=$result.parent_id}}
					</select>
					<label class="inline checkbox" style="font-size:13px;">编辑父分类<input type="checkbox" class="edit_parent_category" value="1"/></label>
					<script>
						$(document).ready(function(){
							$('input.edit_parent_category').click(function(){
								if($(this).attr('checked')) $("select.select_parent_category").fadeIn();
								else $("select.select_parent_category").fadeOut();
							});
							$("select.select_parent_category").change(function(){
								$("input[name='parent_id']").val($(this).val());
								$("span.cat_name").html($(this).find(":checked").text().replace('|_','').replace(/　/g,''));
							});
						});
					</script>
			  </td>
			</tr>
			{{elseif $smarty.get.parent_id>0}}
			<tr>
			  <td>所属父分类：</td>
			  <td>
				<input class="input-xlarge" type="hidden" name="parent_id" value="{{$smarty.get.parent_id}}"/>
				{{$cat_name}}
				<span class="red">*</span>
			  </td>
			</tr>
			{{/if}}
			<tr>
			  <td>唯一名称：</td>
			  <td>
				<input class="input-small" type="text" name="item" value="{{$result.item}}"/> 
				<span class="notice">尽量用英文，默认为空</span>
			  </td>
			</tr>
			<tr>
			  <td>图片：</td>
			  <td>
				{{form type='img' data=$result.image name='image' cat_id=$result.id}}
			  </td>
			</tr>
			{{if $smarty.get.parent_id==0}}
			<tr>
			  <td>允许子菜单级数：</td>
			  <td>
				<input class="input-mini" type="text" name="params[level]" value="{{$result.params.level}}"/>
				<span class="notice">数字</span>
			  </td>
			</tr>
			{{/if}}
			<tr>
			  <td>热门重要：</td>
			  <td>
				{{html_radios name=hot options=array('否','是') checked=$result.hot|default:0}}
				<span class="notice">(设为＂是＂可以防止直接误删除)</span>
			  </td>
			</tr>
			<tr>
			  <td>是否发布：</td>
			  <td>
				{{html_radios name=publish options=array('否','是') checked=$result.publish|default:1}}
			  </td>
			</tr>
			<tr>
			  <td>备注：</td>
			  <td>
				<textarea name="description">{{$result.description}}</textarea>
			  </td>
			</tr>
			{{if in_array($result['id'],'form_model'|C)}}
			<tr>
			  <td>管理表单模型：</td>
			  <td>
			  	<a target="_blank" class="btn btn-mini btn-info" href="index.php?app=form&cat_id={{$result.id}}">查看</a>　　　
				<span class="notice">（关联数据表：<input class="input-mini" type="text" name="params[table]" value="{{$result.params.table}}"/>）</span>
			  </td>
			</tr>
			{{/if}}
			{{include file="include/FORM1.html"}}{{*自定义表单*}}
		  </tbody>
		 </table>
		 <div class="bottom_button">
		 	<button type="submit" class="btn btn-info"><i class="icon-ok icon-white"></i>确认</button>
		 </div>
		</form>
		<!--内容 E-->
</div>
</div>

</body>
</html>